package com.pkk.cloud.support.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.pkk.cloud.support.admin.dto.req.user.OauthBindUserClientReqDto;
import com.pkk.cloud.support.admin.dto.req.user.OauthUserAddReqDto;
import com.pkk.cloud.support.admin.dto.req.user.OauthUserIdReqDto;
import com.pkk.cloud.support.admin.dto.req.user.OauthUserQueryPageReqDto;
import com.pkk.cloud.support.admin.dto.req.user.OauthUserUpdateReqDto;
import com.pkk.cloud.support.admin.dto.resp.user.OauthSysUserDetailRespDto;
import com.pkk.cloud.support.admin.dto.resp.user.OauthSysUserQueryPageRespDto;
import com.pkk.cloud.support.admin.dto.resp.user.OauthUserClientRespDto;
import com.pkk.cloud.support.admin.entity.user.PenguinSysUser;
import com.pkk.cloud.support.admin.oauth2.api.common.resp.PenguinSysUserInfo;
import com.pkk.components.rpc.page.Page;

/**
 * @description: 系统用户
 * @author: peikunkun
 * @create: 2020-03-16 15:40
 **/
public interface PenguinSysUserService extends IService<PenguinSysUser> {

  /**
   * @Description: 获取用户信息依据名称和客户端id
   * @Param: username
   * @Param clientId
   * @return: com.pkk.cloud.support.admin.oauth.api.common.resp.PenguinSysUser
   * @Author: peikunkun
   * @Date: 2020/3/18 0018 下午 6:03
   */
  PenguinSysUserInfo findPenguinUserByNameAndClientId(String username,
      String clientId);

  /**
   * @Description: 保存系统用户
   * @Param: user
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 上午 9:23
   */
  boolean saveSysUser(OauthUserAddReqDto userAddReqDto,String userId);


  /**
   * @Description: 删除系统用户依据id
   * @Param: id
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 上午 9:28
   */
  boolean delSysUserById(Long[] id);

  /**
   * @Description: 更新用户信息依据id
   * @Param: user
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 上午 10:12
   */
  boolean updateSysUserById(OauthUserUpdateReqDto reqDto);

  /**
   * @Description: 获取系统用户分页列表
   * @Param: body
   * @return: java.util.List<com.pkk.cloud.support.admin.dto.resp.user.OauthSysUserQueryPageRespDto>
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 上午 10:59
   */
  PageInfo<OauthSysUserQueryPageRespDto> findSysUserPageList(Page page, OauthUserQueryPageReqDto body);

  /**
   * @Description: 获取用户信息依据id
   * @Param: body
   * @return: com.pkk.cloud.support.admin.dto.resp.user.OauthSysUserDetailRespDto
   * @Author: peikunkun
   * @Date: 2020/4/6 0006 上午 10:18
   */
  OauthSysUserDetailRespDto findUserById(OauthUserIdReqDto body);

  /**
   * @Description: 获取用户客户段信息依据用户id
   * @Param: body
   * @return: com.pkk.cloud.support.admin.dto.resp.user.OauthUserClientRespDto
   * @Author: peikunkun
   * @Date: 2020/4/8 下午9:44
   */
  OauthUserClientRespDto findUserClientByUserId(OauthUserIdReqDto body);

  /**
   * @Description: 绑定用户与访问客户端的信息
   * @Param: request
   * @return: com.pkk.components.rpc.response.CommonResponse<java.lang.Boolean>
   * @Author: peikunkun
   * @Date: 2020/4/8 下午10:05
   */
  boolean bindUserClient(OauthBindUserClientReqDto body);
}
